home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
printing
/
sdump1_5.lzh
/
sdump1_5.s
< prev
Wrap
Text File
|
1990-03-09
|
11KB
|
279 lines
move.l #message,-(sp) ;address of string on stack
move.w #$9,-(sp) ;Prt line
trap #1 ;Gemdos
addq.l #6,sp ;clear stack
pea cont ;address of sup exec
move.w #38,-(sp) ;sup exec funtion
trap #14 ;xbios
addq.l #6,sp ;fix stack
move.w #0,-(sp) ;I don't understand this #
move.l #1100,-(sp) ;amount of bytes to keep
move.w #$31,-(sp) ;keep process
trap #1 ;gemdos
cont:
move.l #start,$502 ;move my address for alt-help
rts
start:
move.w #4,-(sp); ;Getrez
trap #14 ;Xbios call
addq.l #2,sp ;correct stack
move.w d0,rez ;save resolution
;0=low, 1=med, 2=high
cmp.w #2,d0 ;is it high?
bne nc1 ;no
rts
nc1:
cmp.w #1,d0 ;is it medium?
bne nc2
move.w #3,numcolors ;yes, save # of colors
move.l #1,pix_width ;2-1 pixels wide in med res
bra nc3
nc2:
move.w #15,numcolors ;it's low, 16 colors
move.l #3,pix_width ;4-1 pixels wide in low res
nc3:
move.w numcolors,d3
move.l #palette+1,a2 ;get address of palette
add.w d3,a2 ;plus # of colors
get_pal:
move.w #-1,-(sp) ;-1 means to get color
move.w d3,-(sp) ;color number
move.w #7,-(sp) ;Setcolor function
trap #14 ;Xbios call
addq.l #6,sp ;correct stack
move.w d0,d2 ;save color
and.w #$000f,d0 ;get blue value
move.b d0,-(a2) ;save value
move.w d2,d0 ;save color
and.w #$00f0,d0 ;get green color
lsr.w #4,d0 ;shift to low byte
add.b d0,(a2) ;add green value
and.w #$0f00,d2 ;get red color
lsr.w #8,d2 ;shift to low byte
add.b d2,(a2) ;add red value
;decrement address to next color
dbra d3,get_pal ;loop until negative
move.l #0,d6 ;left side of screen
move.l #0,d7 ;bottom of screen
dc.w $a000 ;A-line routine: Init
move.l 12(a0),a3 ;a3=address of Ptsin-arrays
x_inc:
move.w #$b,-(sp) ;Constat
trap #1 ;Gemdos
addq.l #2,sp ;make room on stack
tst.w d0 ;Char available? 0=no
beq x_inc2 ;continue
rts ;abort program
x_inc2:
bsr statchk
btst #0,d0 ;if d0=0, continue
beq xcont ;d0=1, abort
rts
xcont:
move.w #7,d3 ;5 chars to output
move.l #string,a4 ;address of string to output
prtloop:
move.w #0,d0 ;clear d0
move.b (a4)+,d0 ;get byte to output
move.w d0,-(sp) ;char to be outputted
move.w #5,-(sp) ;Cprnout
trap #1 ;GEMDOS
addq.l #4,sp ;correct stack
dbra d3,prtloop ;loop until done
y_dec:
move.l #pix1,a4 ;address of pixel data
move.w #5,d3 ;count 6 times...
y_loop:
move.w #0,d0 ;clear d0
move.w d6,(a3) ;x coor
move.w d7,2(a3) ;y coor
dc.w $a002 ;get pixel color
move.w d0,(a4)+ ;save pixel color
add.b #1,d7 ;increment y cor
dbra d3,y_loop ;do all 6 pixels
print:
sub.b #6,d7 ;reset y coor to original
move.w #5,d2 ;do pixel 6,5,4,3,2,1
move.l #pix1,a5 ;adrs of pixel color storage
move.l #hue1,a4 ;address of offset to prt data
pal_loop:
move.l #palette,a2 ;address of color palette
move.w (a5)+,d1 ;get pixel value
move.b 0(a2,d1.w),d0 ;get HUE value from palette
;for coresponding color
move.w numcolors,d1 ;get resolution
move.w #0,d3
hue_loop:
cmp.b (a2)+,d0 ;compare to other hues
bge nochange ;increment only if d0 is >
add.w #1,d3 ;larger the #, darker the color
nochange:
dbra d1,hue_loop ;continue looping
move.w rez,d0 ;get resolution AGAIN!
cmp.w #0,d0 ;low?
beq lr
cmp.w #1,d0 ;medium?
beq mr
mr:
move.l #medtable,a1 ;address of table for medium
bra saveoffset ;continue
lr:
move.l #lowtable,a1; ;address of table for low
saveoffset:
move.b 0(a1,d3.w),d4 ;get the offset to print data
move.b d4,(a4)+ ;save the offset
dbra d2,pal_loop ;FINALLY! After this is finished,
;hue1, hue2... will
;contain the offset of the
;printing data (c0, c1...)
;all I have to do is load it in,
;and shift it to the correct
;position! (ugh..)
move.l #c0,a4 ;address of print data
move.l pix_width,d5 ;# dots wide for each pixel
dots:
move.w #2,d1 ;do OUTPUT loop 3 times (bytes)
move.l #hue1,a5 ;address of offsets
output:
move.w #0,d2
move.b (a5)+,d2 ;get offset of data
move.b 0(a4,d2.w),d3 ;d3 now contain actual value
lsl #4,d3 ;shift to high bits
move.b (a5)+,d2 ;get offset of hue #2
move.b 0(a4,d2.w),d4 ;d4 contains actual value
add.b d4,d3 ;d3 contain whole byte to
;be outputted to printer
bsr statchk
btst #0,D0 ;IF D0=0, CONT
beq prtcont ;d0=1, abort
rts
prtcont:
move.w d3,-(sp); ;byte to be outputted
move.w #5,-(sp); ;printer device
trap #1 ;bios
addq.l #4,sp ;correct stack
dbra d1,output ;do this for all hues!!!
add.l #1,a4 ;next dot
dbra d5,dots ;..
add.w #1,d6 ;add 1 to x cor
move.w rez,d5 ;get rez.
lsl #1,d5 ;double
move.l #hres,a0 ;address of horizontal reses